#ifndef __INVERTED__INDEX__H__
#define __INVERTED__INDEX__H__

#include <iostream>
#include "streamhandler.h"
#include "treehandler.h"
#include "invertedindexdata.h"

namespace invertedindex{

class InvertedIndex{
	private:
		TreeHandler treeHandler;
		StreamHandler streamHandler;
	public:
		InvertedIndex();
		~InvertedIndex();
		
		bool insert(const InvertedIndexData& invIdxData);
		bool update(const InvertedIndexData& invIdxData);
		bool search(InvertedIndexData& invIdxData);
		bool exist(InvertedIndexData& invIdxData);

		void THtoOstream(std::ostream& out){treeHandler.toOstream(out);}
		void SHtoOstream(std::ostream& out){streamHandler.toOstream(out);}

		void printTreeBlock(std::ostream& out, unsigned int offset);
};

}

#endif

